function getAppFromSource(source) {
if (source instanceof AppDisplay.AppWellIcon) {
return source.app;
- } else if (source.metaWindow) {
- let tracker = Shell.WindowTracker.get_default();
- return tracker.get_window_app(source.metaWindow);
} else {
return null;
}
Lang.bind(this, this._onDragEnd));
Main.overview.connect('item-drag-cancelled',
Lang.bind(this, this._onDragCancelled));
- Main.overview.connect('window-drag-begin',
- Lang.bind(this, this._onDragBegin));
- Main.overview.connect('window-drag-cancelled',
- Lang.bind(this, this._onDragCancelled));
- Main.overview.connect('window-drag-end',
- Lang.bind(this, this._onDragEnd));
// Translators: this is the name of the dock/favorites area on
// the left of the overview
Main.overview.connect('item-drag-begin', Lang.bind(this, this._onDragBegin));
Main.overview.connect('item-drag-end', Lang.bind(this, this._onDragEnd));
Main.overview.connect('item-drag-cancelled', Lang.bind(this, this._onDragEnd));
- Main.overview.connect('window-drag-begin', Lang.bind(this, this._onDragBegin));
- Main.overview.connect('window-drag-cancelled', Lang.bind(this, this._onDragEnd));
- Main.overview.connect('window-drag-end', Lang.bind(this, this._onDragEnd));
+
+ Main.overview.connect('window-drag-begin', Lang.bind(this, this._onWindowDragBegin));
+ Main.overview.connect('window-drag-cancelled', Lang.bind(this, this._onWindowDragEnd));
+ Main.overview.connect('window-drag-end', Lang.bind(this, this._onWindowDragEnd));
},
getSlide: function() {
this.actor.translation_x = 0;
},
+ _onWindowDragBegin: function() {
+ this._onDragBegin();
+ },
+
+ _onWindowDragEnd: function() {
+ this._onDragEnd();
+ },
+
_onDragBegin: function() {
this.inDrag = true;
this.actor.translation_x = 0;
this.updateSlide();
},
+ fadeIn: function() {
+ Tweener.addTween(this.actor, { opacity: 255,
+ time: SIDE_CONTROLS_ANIMATION_TIME / 2,
+ transition: 'easeInQuad'
+ });
+ },
+
+ fadeHalf: function() {
+ Tweener.addTween(this.actor, { opacity: 128,
+ time: SIDE_CONTROLS_ANIMATION_TIME / 2,
+ transition: 'easeOutQuad'
+ });
+ },
+
slideIn: function() {
this.visible = true;
// we will update slideX and the translation from pageEmpty
return 1;
else
return 0;
+ },
+
+ _onWindowDragBegin: function() {
+ this.fadeHalf();
+ },
+
+ _onWindowDragEnd: function() {
+ this.fadeIn();
}
});